package com.youmu.sichuansfc.domain;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "youmu_notify", schema = "youmu", catalog = "")
public class YoumuNotify {
    private Long id;
    private Date addTime;
    private String title;
    private String author;
    private String body;
    private Boolean isDelete;
    private  int readNum;
    private int type;
    // 附件
    private String files;


    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public void setType(Integer type) {
        this.type = type;
    }


    @Id
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }


    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "author")
    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    @Basic
    @Column(name = "body")
    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }


    @Basic
    @Column(name = "is_delete")
    public Boolean getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Boolean delete) {
        isDelete = delete;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        YoumuNotify that = (YoumuNotify) o;
        return id == that.id &&
                isDelete == that.isDelete &&
                Objects.equals(addTime, that.addTime) &&
                Objects.equals(title, that.title) &&
                Objects.equals(author, that.author) &&
                Objects.equals(body, that.body);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, addTime, title, author, body, isDelete);
    }

    @Basic
    @Column(name = "read_num")
    public int getReadNum() {
        return readNum;
    }

    public void setReadNum(int readNum) {
        this.readNum = readNum;
    }

    @Basic
    @Column(name = "type")
    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Basic
    @Column(name = "files")
    public String getFiles() {
        return files;
    }

    public void setFiles(String files) {
        this.files = files;
    }
}
